home *** CD-ROM | disk | FTP | other *** search
/ Drivin' Route 66 / Drivin' Route 66 (1995)(Creative Multimedia)[Mac-PC].iso / pc / rtcm.dir / 00225_Script_ACTIVE MAIN < prev    next >
Text File  |  1995-08-24  |  10KB  |  399 lines

  1. --⌐ 1995, Cambridge Digital Media, Inc.
  2.  
  3. on startMovie
  4.   nosprites
  5.   global FYI
  6.   if FYI > 11 AND FYI < 164 then
  7.     set the visible of sprite 4 to false
  8.     updatestage
  9.     --gonext
  10.     set the mouseDownScript to "goNext"
  11.   end if
  12.   global cursorPic, cursorMask, hotOne
  13.   
  14.   set the mouseDownScript to "playVroom"
  15.   --set the cursor of sprite 1 to -1
  16.   put the number of cast "keyCon" into cursorPic
  17.   put the number of cast "keyCon.mask" into cursorMask
  18.   -- puppetSprite 8,1
  19.   put 0 into hotOne
  20.   
  21. end
  22.  
  23.  
  24. on playVroom
  25.   global hotOne,nextMode
  26.   if not (rollOver(9)) then
  27.     if hotOne <> 0 then
  28.       -- puppetSound "chevy rev"
  29.       updateStage
  30.       doDelay
  31.       repeat while the mouseDown
  32.         nothing
  33.       end repeat
  34.       -- put integer(item 1 of hotOne)*10 + integer(item 2 of hotOne)
  35.       put makeCar(hotOne) into hotCar
  36.       --put hotCar
  37.       put 1 into nextMode
  38.       puppetSprite 10,0
  39.       puppetSprite 11,0
  40.       puppetSprite 12,0
  41.       puppetSprite 13,0
  42.       goThere integer(hotCar),1
  43.     else
  44.       -- huh?
  45.       
  46.     end if
  47.   end if
  48. end
  49.  
  50. on grindcars
  51.   repeat with x = 1 to the number of lines in field "carTable"
  52.     delete char 1 to 3 of line x of field "carTable"
  53.   end repeat
  54. end
  55.  
  56. on grindIndex
  57.   put empty into field "carIndex"
  58.   repeat with x = 1 to the number of lines in field "carTable"
  59.     put (line x of field "carTable") into theChunk
  60.     put integer((theChunk)+0) into indNum
  61.     put line x of field "hfs" into line indNum of field "carIndex"
  62.   end repeat
  63. end
  64.  
  65. on makeCar thepair
  66.   if integer(thepair) = 0 then
  67.     return 0
  68.   else
  69.     put integer(item 1 of thepair)*10 + integer(item 2 of thepair) into indNum
  70.     put integer(deriveFNum(line indNum of field "carIndex")) into temp
  71.     --  if temp > 14 then 
  72.     --    put temp+1 into temp
  73.     --  end if
  74.     return temp
  75.   end if
  76.   -- return deriveCName(deriveFNum(line indNum of field "carIndex"))
  77. end
  78.  
  79. on deriveCName input
  80.   delete char 1 to 2 of input
  81.   put the itemDelimiter into saveDel
  82.   set the itemDelimiter to "."
  83.   delete item 2 of input
  84.   set the itemDelimiter to saveDel
  85.   return input
  86. end 
  87.  
  88. on deriveFNum input
  89.   delete char 1 of input
  90.   put the itemDelimiter into saveDel
  91.   set the itemDelimiter to "/"
  92.   delete item 2 of input
  93.   set the itemDelimiter to saveDel
  94.   return input
  95. end 
  96.  
  97. on idle
  98.   if the frameLabel = "MENU" then
  99.     global hotOne
  100.     if not (rollOver(9)) then
  101.       --    set the locV of sprite 8 to (the mouseV - 25)
  102.       --    set the locH of sprite 8 to (the mouseH - 40)
  103.       put checkForHit() into hotOne
  104.       if hotOne <> 0 then 
  105.         showItAll 
  106.         placeBox hotOne
  107.         CallCar hotOne
  108.       else 
  109.         hideInShame
  110.         CallCar 0
  111.       end if
  112.     else
  113.       hideInShame
  114.       
  115.       --put checkForHit()
  116.     end if
  117.     
  118.     updateStage
  119.   else
  120.     cursor -1
  121.   end if
  122.   
  123. end
  124.  
  125.  
  126. on showItAll
  127.   global cursorPic, cursorMask,marqueeMark
  128.   
  129.   if marqueeMark then
  130.     set the ink of sprite 8 to 4
  131.     put 0 into marqueeMark
  132.   else
  133.     set the ink of sprite 8 to 0
  134.     put 1 into marqueeMark
  135.   end if
  136.   updateStage
  137.   set the visible of sprite 8 to 1
  138.   --set the visible of sprite 12 to 1
  139.   set the visible of sprite 30 to 0
  140.   put the number of cast "keyCon" into iconNum
  141.   put the number of cast "keyCon.mask" into maskNum
  142.   
  143.   --cursor [220,221]
  144.   cursor [cursorPic, cursorMask] --òò
  145. end
  146.  
  147.  
  148. on hideInShame
  149.   if the visible of sprite 8 then
  150.     set the visible of sprite 8 to 0
  151.     --set the visible of sprite 12 to 0
  152.     set the visible of sprite 30 to 0
  153.     set the ink of sprite 8 to 4
  154.   end if
  155.   cursor 0
  156. end
  157.  
  158.  
  159.  
  160. on checkForHit
  161.   put 0 into theNumber
  162.   put 0 into xHit
  163.   put 0 into yHit
  164.   put 0 into xHit
  165.   put 0 into yHit
  166.   put 0 into breakit
  167.   repeat with xcnt = 15 to 22
  168.     if rollOver(xcnt) then 
  169.       put xcnt into xHit
  170.       repeat with ycnt = 23 to 29
  171.         if rollOver(ycnt) then 
  172.           put ycnt into yHit
  173.           put 1 into breakit
  174.           exit repeat
  175.         end if
  176.       end repeat
  177.     end if
  178.     if breakit then exit repeat
  179.   end repeat
  180.   if (xHit <> 0) and (yHit <> 0) then put (xHit - 14) & "," & (yHit - 22) into theNumber
  181.   return theNumber
  182. end
  183.  
  184.  
  185. on placeBox which
  186.   put integer(item 1 of which) into hotX
  187.   put integer(item 2 of which) into hotY
  188.   put word hotX of line hotY of field "locLookup" into theLoc
  189.   set the locH of sprite 8 to integer(item 1 of theLoc)
  190.   set the locV of sprite 8 to integer(item 2 of theLoc)
  191.   --puppetTransition 23  
  192. end
  193.  
  194.  
  195. on setTable
  196.   repeat with ln = 1 to (the number of lines in field "locLookup")
  197.     repeat with wd = 1 to (the number of words in line ln of field "locLookup")
  198.       put string((integer(2 + (80 * (wd - 1)))) & "," & integer(100 + (54 * (ln - 1)))) into ¼
  199. word wd of line ln of field "locLookup"
  200.     end repeat
  201.   end repeat
  202. end
  203.  
  204.  
  205. on CallCar hotOne
  206.   put makeCar(hotOne) into hotCar
  207.   showName integer(hotCar)
  208. end
  209.  
  210. on showName thePic
  211.   global lastTimePic
  212.   puppetSprite 10,1
  213.   if thePic <> lastTimePic then
  214.     if thePic = 0 then
  215.       put getNum("BlankName") into rightNum
  216.       if the castNum of sprite 10 <> rightNum then
  217.         set the castNum of sprite 10 to rightNum
  218.         updateStage
  219.       end if
  220.     else
  221.       put line integer(thePic) of field "hfs" into gotKey
  222.       put gotKey
  223.       put (deriveFName(gotKey)) into temp
  224.       -- put temp
  225.       set the castNum of sprite 10 to getNum(temp)
  226.       updateStage
  227.       -- put temp
  228.       -- put (deriveFNum(gotKey)) into temp
  229.       --  put integer(temp) into thePic
  230.       -- put thePic
  231.     end if
  232.   end if
  233.   -- puppetSprite 10,0
  234.   put thePic into lastTimePic
  235. end
  236.  
  237. on deriveFName input
  238.   -- delete char 1 of input
  239.   put the itemDelimiter into saveDel
  240.   set the itemDelimiter to "/"
  241.   delete item 1 of input
  242.   set the itemDelimiter to saveDel
  243.   return "M" & input
  244. end 
  245.  
  246. on getNum input
  247.   return the number of cast input
  248. end
  249.  
  250. on goThere thePic,theMode
  251.   global nextMode,gPic
  252.   set the volume of sound 2 to 130
  253.   cursor 4
  254.   -- put thePic && theMode
  255.   put thePic into gPic
  256.   put line integer(thePic) of field "hfs" into gotKey
  257.   put (deriveFNum(gotKey)) into temp
  258.   -- delete char 1 of temp
  259.   put integer(temp) into thePic
  260.   
  261.   --  put reverseX(thePic) into thePic
  262.   if theMode = 0 then
  263.     -- alert string(thePic)
  264.     -- beep
  265.     --    set the visible of sprite 1 to false
  266.     --    go (the frame)+1
  267.     --    go frame (thePic*4)+label("c01")-3
  268.   else
  269.     repeat with s = 6 to 14
  270.       set the visible of sprite s to true
  271.     end repeat
  272.     if theMode = 1 then
  273.       set the visible of sprite 2 to true
  274.       set the visible of sprite 3 to true
  275.       set the visible of sprite 4 to false
  276.     else if theMode = 2 then
  277.       set the visible of sprite 2 to false
  278.       set the visible of sprite 3 to true
  279.       set the visible of sprite 4 to true
  280.       repeat with s = 9 to 14
  281.         set the visible of sprite s to false
  282.       end repeat
  283.     else if theMode = 3 then
  284.       puppetSprite 11,0
  285.       puppetSprite 12,0
  286.       puppetSprite 13,0
  287.       repeat with s = 2 to 14
  288.         set the visible of sprite s to false
  289.       end repeat
  290.       set the visible of sprite 5 to true
  291.     else if theMode = 4 then
  292.       
  293.       --evil
  294.       set the visible of sprite 2 to 1 
  295.       set the visible of sprite 3 to 1 
  296.       
  297.       
  298.     end if
  299.     set the visible of sprite 1 to true
  300.     -- updateStage
  301.     --alert string (((thePic*4)-3) + (label("c01")-1))
  302.     go frame ((thePic*4)-3) + (label("c01")-1)
  303.   end if
  304.   -- updateStage
  305.   set the mouseDownScript to "goNext"
  306.   cursor -1
  307. end
  308.  
  309.  
  310. on reverseX input
  311.   return integer(line input of field "reverse")
  312. end
  313.  
  314. on goNext
  315.   global nextMode,gPic, where, thesound
  316.   global goNow
  317.   doDelay
  318.   if the doubleClick then
  319.     nothing
  320.   else
  321.     repeat with n = 9 to 14
  322.       if rollover(n) AND (the castNum of sprite n > 0) then
  323.         --evil
  324.         put 1 into goNow
  325.         return "no signs"
  326.       end if
  327.     end repeat
  328.     Sound stop 1
  329.     puppetSound 0
  330.     updateStage
  331.     put 1 into goNow
  332.     put nextMode+1 into nextMode
  333.     put "RTC" & goodPad(gPic) & "TXA.AIF" into theSound
  334.     if nextMode > 4 then put 1 into nextMode
  335.     goThere integer(gPic),integer(nextMode)
  336.     if nextMode = 2 then
  337.       if theSound > 0 then
  338.         puppetSound 0 
  339.         set the volume of sound 1 to 255
  340.         sound playfile 1, where & theSound
  341.         updateStage
  342.       end if
  343.     end if
  344.   end if
  345. end
  346.  
  347. on goFrom
  348.   global nextMode,gPic, theSound
  349.   global goNow
  350.   set the MouseUpScript to "doNothing"
  351.   Sound stop 1
  352.   puppetSound 0
  353.   updateStage
  354.   put 1 into goNow
  355.   put "RTC" & goodPad(gPic) & "TXA.AIF" into theSound
  356.   goThere integer(gPic),integer(nextMode)
  357. end
  358.  
  359.  
  360. on goodPad input
  361.   put string(input) into temp
  362.   if length(temp) < 2 then
  363.     put "0" before temp
  364.   end if
  365.   return temp
  366. end 
  367.  
  368. on doNothing
  369.   nothing
  370. end
  371.  
  372.  
  373. on goBack
  374.   global nextMode,gPic, theSound
  375.   global goNow
  376.   Sound stop 1
  377.   puppetSound 0
  378.   updateStage
  379.   put 1 into goNow
  380.   put "RTC" & goodPad(gPic) & "TXA.AIF" into theSound
  381.   repeat with s = 6 to 14
  382.     puppetSprite s,0
  383.     set the visible of sprite s to true
  384.   end repeat
  385.   go frame "preMenu"
  386.   unload
  387. end
  388.  
  389. on dealWithManics
  390.   put "doubleclick!"
  391. end
  392.  
  393. on padQT input
  394.   put string(input) into input
  395.   if length(input) = 1 then
  396.     put "0" before input
  397.   end if
  398.   return input
  399. end